﻿using Microsoft.Xna.Framework;

namespace Gamev1
{
    public class Camera
    {
        public Matrix Transform;
        public Vector2 Center { set; get; }
        private const int screenCenterHeight = Game1.screenHeight / 2;

        public void Update(GameTime gameTime, Character character)
        {
            checkBounds(character);
            Transform = Matrix.CreateTranslation(0, -Center.Y, 0);
        }

        public void checkBounds(Character character)
        {
            float characterCenter = character.Position.Y + character.Rectangle.Height / 2;
            Center = new Vector2(0, characterCenter - screenCenterHeight - 130);
        }
    }
}
